﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using kim.Common;
using System.Data;

namespace kim.Web.Admin.Photo
{
    public partial class List : UI.ManagePage
    {
        protected int fid, typeid, pageIndex, pageSize;
        protected string StrPage;
        protected void Page_Load(object sender, EventArgs e)
        {
            labtitle.Text = "相册列表";
            typeid =Common.KIMRequest.GetInt("typeid", 1);
            fid = Common.KIMRequest.GetInt("fid", 1);
            GetStrPage();
        }
        private void GetStrPage()
        {
            pageIndex = KIMRequest.GetInt("p", 1);
            string strWhere = "typeid=" + typeid + "and fid=" + fid;
            string strUrl = "List.aspx?p=__id__&typeid=" + typeid + "&fid=" + fid;
            pageSize = 10;
            pageIndex = KIMRequest.GetInt("p", 1);
            kim.BLL.Photo bll = new kim.BLL.Photo();
            int count = SqlDbHelper.GetPageCurrent("Photo", strWhere);
            using (DataSet dt = bll.GetNewsPager(pageIndex, pageSize, "", "AddTime Desc", strWhere))
            {
                rptlist.DataSource = dt;
                rptlist.DataBind();
            }
            StrPage = kim.Common.Utils.OutPageList(pageSize, pageIndex, count, strUrl, 8);
        }
    }
}